Skip to content

Simplify 'buf generate' and fix insertion points#621

Merged
amckinney merged 15 commits into
mainfrom
generate
Oct 1, 2021
Merged

Simplify 'buf generate' and fix insertion points#621
amckinney merged 15 commits into
mainfrom
generate

Conversation

@amckinney
Copy link
Copy Markdown
Contributor

Fixes #600 and fixes #605

This revisits the buf generate command so that we consolidate all of our generation logic in appproto and appprotoos. With this, buf protoc, buf generate, and our server-side remote generation all use the same code paths.

This also fixes how we handle insertion points so that our behavior is aligned with protoc: we only permit insertion points to act upon other plugins configured to the same _out directory. For example,

$ protoc --insertion-point-receiver_out=gen/proto/insertion --insertion-point-writer_out=gen/proto/insertion

The insertion-point-writer will only have access to the files deposited in gen/proto/insertion, which is correctly configured above. Note that this was not previously the case.

Aside from the unit tests included here, this was tested against a variety of different cases, including combinations of remote and local plugins (including insertion points on either side).

Comment thread private/buf/bufgen/generator.go Outdated
Comment thread private/buf/bufgen/generator.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Insertion point output paths are not respected panic in buf generate with misconfigured plugin

3 participants